package com.daoeping.action;

import java.util.ArrayList;
import java.util.List;
import com.daoeping.data.Bsc_certificate;
import com.daoeping.domain.JsonData;
import com.daoeping.service.Bsc_certificateService;
import com.daoeping.util.ConverntJsonData;
import com.opensymphony.xwork2.ActionSupport;

public class Bsc_certificateAction extends ActionSupport{
	
	private static final long serialVersionUID = -1917971132885271519L;
	private Bsc_certificateService bsc_certificateService;
	private JsonData jsonData;
	private List<Bsc_certificate> bsc_certificateList;
	
	public Bsc_certificateService getBsc_certificateService() {
		return bsc_certificateService;
	}

	public void setBsc_certificateService(
			Bsc_certificateService bsc_certificateService) {
		this.bsc_certificateService = bsc_certificateService;
	}

	public List<Bsc_certificate> getBsc_certificateList() {
		return bsc_certificateList;
	}

	public void setBsc_certificateList(List<Bsc_certificate> bsc_certificateList) {
		this.bsc_certificateList = bsc_certificateList;
	}

	public JsonData getJsonData() {
		return jsonData;
	}

	public void setJsonData(JsonData jsonData) {
		this.jsonData = jsonData;
	}

	

	public String findAllCertificate(){
		jsonData = new JsonData();
		bsc_certificateList = bsc_certificateService.findBsc_certificateList();
		List <String[]> strList = new ArrayList<String[]>();
		for (Bsc_certificate bsc_certificate : bsc_certificateList) {
			String [] strarr = new String[2];
			strarr[1] = bsc_certificate.getId()+"";
			strarr[0] = bsc_certificate.getName();
			strList.add(strarr);
		}
		jsonData.setJsonData( new ConverntJsonData().getJsonData(strList)+"");
	return "allcertificate";
		
	}
	
}
